package cn.huiyunche.base.service.vo;

import cn.huiyunche.base.service.enums.AccPaytypeEnum;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;

public class CTurnoverDWaybillVo implements Serializable {
    private Long id;

    private Long userId;

    private String userName;

    private Integer userType;

    private Long orderId;

    private BigDecimal orderFee;

    // 费用
    private BigDecimal orderActPay;

    private Integer payType;

    // 业务类型 描述
    private String payTypeText;

    private Long billId;

    // 交易时间
    private Date createTime;

    private String remark;

    private String departProvince; // 发车省
    private String departCity; // 发车市
    private String departCounty; // 发车区县
    private String arrivalProvince; // 送达省
    private String arrivalCity; // 送达市
    private String arrivalCounty; // 送达县

    private String departAddr; // 发车地址
    private String arrivalAddr; // 目的地址

    // 月份显示
    private String monthText;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public BigDecimal getOrderFee() {
        return orderFee;
    }

    public void setOrderFee(BigDecimal orderFee) {
        this.orderFee = orderFee;
    }

    public String getOrderActPay() {
        if (orderActPay.compareTo(BigDecimal.ONE) == 1) {
            return "+".concat(orderActPay + "");
        } else {
            return orderActPay + "";
        }
    }

    public void setOrderActPay(BigDecimal orderActPay) {
        this.orderActPay = orderActPay;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public String getPayTypeText() {
        return payTypeText;
    }

    public void setPayTypeText(String payTypeText) {
        this.payTypeText = payTypeText;
    }

    public Long getBillId() {
        return billId;
    }

    public void setBillId(Long billId) {
        this.billId = billId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getDepartProvince() {
        return departProvince;
    }

    public void setDepartProvince(String departProvince) {
        this.departProvince = departProvince;
    }

    public String getDepartCity() {
        return departCity;
    }

    public void setDepartCity(String departCity) {
        this.departCity = departCity;
    }

    public String getDepartCounty() {
        return departCounty;
    }

    public void setDepartCounty(String departCounty) {
        this.departCounty = departCounty;
    }

    public String getArrivalProvince() {
        return arrivalProvince;
    }

    public void setArrivalProvince(String arrivalProvince) {
        this.arrivalProvince = arrivalProvince;
    }

    public String getArrivalCity() {
        return arrivalCity;
    }

    public void setArrivalCity(String arrivalCity) {
        this.arrivalCity = arrivalCity;
    }

    public String getArrivalCounty() {
        return arrivalCounty;
    }

    public void setArrivalCounty(String arrivalCounty) {
        this.arrivalCounty = arrivalCounty;
    }

    public String getDepartAddr() {
        if (payType == AccPaytypeEnum.WITHDRAWAL.getValue()) {
            return "";
        }
        return departAddr;
    }

    public void setDepartAddr(String departAddr) {
        this.departAddr = departAddr;
    }

    public String getArrivalAddr() {
        if (payType == AccPaytypeEnum.WITHDRAWAL.getValue()) {
            return "提现";
        }
        return arrivalAddr;
    }

    public void setArrivalAddr(String arrivalAddr) {
        this.arrivalAddr = arrivalAddr;
    }

    public String getMonthText() {
        createTime = null == createTime ? new Date() : createTime;
        Calendar c = Calendar.getInstance();
        int currentYear = c.get(Calendar.YEAR);
        c.setTime(createTime);
        monthText = c.get(Calendar.MONTH) + 1 + "月";
        int year = c.get(Calendar.YEAR);
        if (year != currentYear) {
            monthText = year + "年" + monthText;
        }
        return monthText;
    }

    public void setMonthText(String monthText) {
        this.monthText = monthText;
    }

    @Override
    public String toString() {
        return "CTurnoverDWaybillVo{" +
                "id=" + id +
                ", userId=" + userId +
                ", userName='" + userName + '\'' +
                ", userType=" + userType +
                ", orderId=" + orderId +
                ", orderFee=" + orderFee +
                ", orderActPay=" + orderActPay +
                ", payType=" + payType +
                ", payTypeText='" + payTypeText + '\'' +
                ", billId=" + billId +
                ", createTime=" + createTime +
                ", remark='" + remark + '\'' +
                ", departProvince='" + departProvince + '\'' +
                ", departCity='" + departCity + '\'' +
                ", departCounty='" + departCounty + '\'' +
                ", arrivalProvince='" + arrivalProvince + '\'' +
                ", arrivalCity='" + arrivalCity + '\'' +
                ", arrivalCounty='" + arrivalCounty + '\'' +
                ", departAddr='" + departAddr + '\'' +
                ", arrivalAddr='" + arrivalAddr + '\'' +
                ", monthText='" + monthText + '\'' +
                '}';
    }
}
